<p-dialog [width]="width" [(visible)]="display" modal="modal"  [responsive]="true"  (onHide)="closeInspectionMask(false)" class="institution" >
  <p-header>
    查询巡检计划
  </p-header>
  <div class="ui-g">
    <div class="ui-g-12">
      <div class="file-box">
        <div class="mybutton ui-g-5 ui-md-5 ui-lg-5 ui-sm-12">
          <label class="ui-sm-4">巡检计划名称：</label>
          <input pInputText type="text" placeholder="输入巡检计划名称"  [(ngModel)]="queryModel.name" />
        </div>
        <div class="mybutton ui-g-5 ui-md-5 ui-lg-5 ui-sm-12">
          <label class="ui-sm-4">计划状态：</label>
          <select [(ngModel)]="queryModel.status" class="ui-sm-7">
            <option *ngFor=" let sta of status" value="{{sta.key}}">{{sta.val}}</option>
          </select>
        </div>
        <div class="mybutton ui-g-2 ui-md-2 ui-lg-2 ui-sm-12">
          <button pButton type="button"  label="查询"   ngClass="ui-sm-12 sm-margin-bottom" (click)="suggestInsepectiones()"></button>
          <!--<button pButton type="button"  label="删除"   ngClass="ui-sm-12" (click)="deleteInsepection()" [disabled]="selectInsepections.length === 0 || selectInsepections.length>1" ></button>-->
        </div>
        <div class="mybutton ui-g-12 ui-md-12ui-lg-12">

          <p-dataTable [value]="inspectionsObject"
                       [totalRecords]="totalRecords"  [(selection)]="selectInsepections" [responsive]="true">
            <!--<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>-->
            <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
            <p-column header="操作">
              <ng-template let-car="rowData" pTemplate="body" let-i="rowIndex">
                <button pButton type="button" label="查看详情" (click)="showOption(inspectionsObject[i])"></button>
                <button pButton type="button" label="终止" (click)="sureApproved(inspectionsObject[i])" *ngIf="inspectionsObject[i]['status'] === '进行中'" ></button>
                <button pButton type="button" label="启动" (click)="sureStartApproved(inspectionsObject[i])" *ngIf="inspectionsObject[i]['status'] === '已终止'" ></button>
                <button pButton type="button" label="查看任务" (click)="showTask(inspectionsObject[i])" ></button>
                <button pButton type="button"  label="删除"   ngClass="ui-sm-12" (click)="deleteInsepection(inspectionsObject[i])" ></button>
              </ng-template>
            </p-column>
            <ng-template pTemplate="emptymessage">
              当前没有数据
            </ng-template>
          </p-dataTable>
          <p-paginator rows="10" [totalRecords]="totalRecords" [rowsPerPageOptions]="[10,20,30]" (onPageChange)="paginate($event)"></p-paginator>
        </div>

      </div>
    </div>
  </div>
  <p-footer>
    <button type="button" pButton icon="fa-close" label="关闭"  (click)="closeInspectionMask(false)"></button>
  </p-footer>
</p-dialog>
<app-view-detail
  *ngIf="showViewDetailMask"
  [cuerrntInspectionPlan]="cuerrntInspectionPlan"
  (closeMask)="closeViewDetailMask($event)"
></app-view-detail>
<app-update-plan-status
  *ngIf="showViewUpdatePlan"
  [currentInspection]="cuerrntInspectionPlan"
  (updateDev)="updateDevice($event)"
  (closeAddMask)="closeAddPlanTreeMask($event)"
></app-update-plan-status>
